Field of the Invention
The present invention relates to a focus detection apparatus and a method for controlling the same, and in particular to a focus detection apparatus that performs focus control using an image signal obtained by an image sensor for capturing an image, and a method for controlling the same.
Description of the Related Art
In Digital cameras and video cameras, a contrast detection autofocus (referred to hereinafter as AF) method is typically employed that detects signals corresponding to contrast evaluation values of a subject, using output signals of an image sensor such as a CCD or CMOS sensor, and brings the subject into focus. In this method, the contrast evaluation values of the subject are sequentially detected while a focus lens is moved over a predetermined movement range in a direction of an optical axis (AF scanning operation), and a focus lens position having the highest contrast evaluation value is detected as an in-focus position.
Furthermore, focus detection apparatuses are known that store output signals from an image sensor in an internal memory (SDRAM), and obtain a contrast evaluation value between the stored output signals in the main-scanning direction and the sub-scanning direction of the image sensor, thereby performing more accurate focus control. Since the main-scanning direction of the image sensor is typically the horizontal direction and the sub-scanning direction is typically the vertical direction, contrast evaluation in the sub-scanning direction, or the vertical direction, requires memory capacity that can sufficiently record signals (sensor signals) of a plurality of lines from the image sensor.
Japanese Patent Laid-Open No. 8-317272 discloses a method for storing sensor signals in a state in which they are summed up in the horizontal direction (main-scanning direction), in order to reduce memory capacity when performing contrast evaluation in the vertical direction. Sensor signals of a single line are reduced to a summed signal that is a fraction of the sensor signals, and thus it is possible to realize focus state detection in the vertical direction (sub-scanning direction) with small memory capacity.
Japanese Patent Laid-Open No. 2008-199477 discloses a method that changes a thinning rate according to a focus state level, in order to reduce a calculation cost of focus state detection. High accuracy focus state detection is possible by increasing the thinning rate when an image is significantly blurred, and decreasing the thinning rate in the vicinity of an in-focus position.
However, in the conventional technique disclosed in Japanese Patent Laid-Open No. 8-317272, sensor signals in the main-scanning direction are summed with a constant adding rate to perform focus state detection in the vertical direction, irrespective to the focus state level, which may cause deterioration in accuracy in the focus state detection. For example, if an adding rate is increased in the vicinity of an in-focus position, focus state detection is performed in a state in which a high-frequency component is lost, resulting in focus state detection that does not have sufficiently high accuracy.
On the other hand, although the conventional technique disclosed in Japanese Patent Laid-Open No. 2008-199477 relates to the method that changes a thinning rate of a sensor signal according to the focus state level of a subject, no filtering processing at the time of obtaining a contrast evaluation value is disclosed. Nor is contrast evaluation in the sub-scanning direction disclosed. For example, in Japanese Patent Laid-Open No. 2008-199477, if an image is largely blurred, the focus state level is determined to be low and a thinning rate is set to a large value. In this case, evaluation that is performed using a signal that has passed through a high frequency band-pass filter may result in focus state detection that does not have sufficiently high accuracy.